package com.wksc.framework.impexp.writer;

import java.io.IOException;

import com.wksc.framework.impexp.constants.PostfixType;
import jxl.read.biff.BiffException;

/**
 * <p> Title(文件名): ${file_name} </p>
 * <p> Description(描述): ${todo} </p>
 * <p> Copyright(版权): Copyright (c) ${year} </p>
 * <p> Company(公司): 成都四方信息技术有限公司 </p>
 * <p> CreateTime(生成日期)：11-11-13下午5:33 </p>
 *
 * @author wanglei
 * @version ${project_name}
 */
public class WriterFactory {
    public static Writer getWriter(PostfixType postfixType) throws IOException, BiffException {
        Writer writer;
        switch (postfixType) {
            case XLS:
                writer = new XlsWriter();
                break;
            case CSV:
                writer = new CsvWriter();
                break;
            case TXT:
                writer = new TxtWriter();
                break;
            default:
                writer = new CsvWriter();
        }
        return writer;
    }
}
